<?php include("config.php"); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title><?php echo $sitename; ?> - Apply For Award</title>
<meta name="description" content="<?php echo $sitename; ?> - Apply For Award">
<meta name="keywords" content="free to try, software, shareware, freeware, developers, vendors, download, PAD">
<meta name="robots" content="all">
<meta name="author" content="Andrey Aleksanyants, M.D.">
<meta name="copyright" content="<?php echo $sitename; ?>">
<meta http-equiv="imagetoolbar" content="no">
<meta http-equiv="Page-Enter" content="BlendTrans(Duration=4)">
<meta http-equiv="Page-Exit" CONTENT="BlendTrans(Duration=4)">
<link rel="stylesheet" type="text/css" href="<?php echo $cssfile; ?>">
<link rel="shortcut icon" href="favicon.ico">
<link rel="alternate" type="application/rss+xml" title="New Releases and Updates" href="rss.php"/>
<link rel="alternate" type="application/rss+xml" title="Most Popular Software" href="rss.php?feed=popular"/>
<link rel="alternate" type="application/rss+xml" title="Top Rated Software" href="rss.php?feed=rating"/>
<script language="javascript">
<!--
function formcheck() {
	if(document.allpyaward.progid.value=="") {
		alert("You did not enter Program ID!");
		document.allpyaward.progid.focus();
		return false;
	}
	if(document.allpyaward.title.value=="") {
		alert("You did not enter Program Title!");
		document.allpyaward.title.focus();
		return false;
	}
	if(document.allpyaward.version.value=="") {
		alert("You did not enter Program Version!");
		document.allpyaward.version.focus();
		return false;
	}
	if(document.allpyaward.dlsize.selectedIndex==0) {
		alert("You did not select Download Size!");
		document.allpyaward.dlsize.focus();
		return false;
	}
	if((document.allpyaward.backlink.value=="") || (document.allpyaward.backlink.value=="http://")) {
		alert("You did not enter Backlink URL!");
		document.allpyaward.backlink.focus();
		return false;
	}
	if(document.allpyaward.mtext.value.length>1000) {
		alert("Please enter at most 1000 characters in comment text field!");
		document.allpyaward.mtext.focus();
		return false;
	}
	return true;
}

function collapseAll() {
	var LItems=document.getElementById("catlist").getElementsByTagName("li");
	for(o=0; o<LItems.length; o++) {
		if(LItems[o].className=="open") {
			LItems[o].className="close";
		}
		if(LItems[o].getElementsByTagName("ul").length>0) {
			curChilds=LItems[o].getElementsByTagName("span");
			if(curChilds.length>0) {
				curChilds[0].onclick=function() {
					ShowHide(this.parentNode);
				}
				if(curChilds[0].className=="open") {
					curChilds[0].className="close";
				}
			}
			curChilds=LItems[o].getElementsByTagName("a");
			if(curChilds.length>0) {
				curChilds[0].onclick=function() {
					ShowHide(this.parentNode);
					return false;
				}
			}
		}
	}
}

function ShowHide(curHeader) {
	if(curHeader.className=="close") {
		curHeader.className="open";
	}
	else if(curHeader.className=="open") {
		curHeader.className="close";
	}
}
//-->
</script>
</head>
<body onLoad="collapseAll();">
<?php include("header.inc"); ?>
<table bgcolor="White" width="980" align="center">
<tr><td width="180" valign="top">
<table width=180 border=0 cellpadding=0 cellspacing=0 background="images/middle.gif">
          <tbody>
            <tr>
              <td height="2" class="table-top"></td>
            </tr>
            <tr>
              <td align=left valign=top class="left">
<?php
$which_class = "Audio & Multimedia";
include_once('categories1.inc');
?>
</td>
            </tr>
            <tr>
              <td height="8" class="table-bottom"></td>
            </tr>
          </tbody>
        </table>
      <br>
        <table width=180 
            border=0 align="center" cellpadding=0 cellspacing=0 
            background="images/middle.gif">
          <tbody>
            <tr>
              <td width="8" height="2" class="table-top"></td>
              <td width="172" class="table-top"></td>
            </tr>
            <tr>
              <td align=left valign=center class="left-rss">:<br>
                  <br>
                  <p></p>
                <p></p></td>
              <td align=left valign=center class="left-rss"><span class="left-b"><img src="images/rss.gif" width="36" height="14">RSS Feeds</span><br>
                <img src="images/rss-1.gif" alt="new" width="14" height="14"><a href="rss.php">New Releases and Updates</a><br>
                  <img src="images/rss-1.gif" alt="new" width="14" height="14"><a href="rss.php?feed=popular">Most Popular Software</a><br>
                  <img src="images/rss-1.gif" alt="new" width="14" height="14"><a href="rss.php?feed=rating">Top Rated Software</a></td>
            </tr>
            <tr>
              <td height="8" colspan="2" class="table-bottom"></td>
            </tr>
          </tbody>
        </table>
&nbsp;</td>
<td valign="top">
<t>
<h1>Apply for <?php echo $sitename; ?> Award</h1>
<p><?php echo $sitename; ?> is awarding the software products by evaluating them and, if they pass our evaluation, giving them a graphical award that can be displayed on the software author's web site. You can get the award graphics from <a href="awards.html"><?php echo $sitename; ?> Awards</a> page.</p>
<p>If you wish that your program be evaluated by us, please <a href="#form">fill the form below</a> providing the following information:</p>
<ol>
<li>Program ID, Title and Version (as it appears on <?php echo $sitename; ?>);</li>
<li>Approximate Download Size of your software;</li>
<li>URL of the page on your web site where you have placed the backlink to us (you can see linking examples on <a href="linktous.php">Link To Us</a> page);</li>
<li>If your software has any functional limitations for unregistered version, please provide us the registration information made out to "<?php echo $sitename; ?>". We guarantee that it will not be shared.</li>
</ol>
<p>Please note that we are currently unable to evaluate non-Windows software and software that requires any special equipment or hardware. Also we do not evaluate the software products related to the following categories, including, but not limited to: desktop themes, screensavers, wallpaper managers, database &amp; scientifis tools, educational tools, development tools and components, etc.</p>
<p>The following criteria are taken into consideration when reviewing a software:</p>
<li>Features and Performance;</li>
<li>Usability and Appearance;</li>
<li>Stability;</li>
<li>Documentation assistance;</li>
<li>Pricing;</li>
<li>Download size (small is best);</li>
<br>
<p>All the software products are rated on a 1 to 5 scale:<br>
<b>"1 Star"</b> (Awful) - The software scores low on all of its rating criteria and has no meaningful strengths.<br>
<b>"2 Stars"</b> (Poor) - The software does what it is supposed to do, but suffers from a few additional major flaws.<br>
<b>"3 Stars"</b> (Good) - The software does what it is supposed to do and has no major flaws, but there may be similar programs that work better or have more features.<br>
<b>"4 Stars"</b> (Very Good) - Despite a few minor flaws, the software does what it claims and only needs a small touch either in the functionality or the interface.<br>
<b>"5 Stars"</b> (Excellent) - The software scores high on all of its rating criteria and has no meaningful drawbacks.</p>
<p>In addition, if your software does not contain any viruses, adware or spyware modules, it will be awarded by <b>"100%&nbsp;Clean"</b> Award.</p>
<br><a name="form"></a>
<?php

// Requesting form data
$progid       = $_POST["progid"];
$title        = $_POST["title"];
$version      = $_POST["version"];
$dlsize       = $_POST["dlsize"];
$comment      = $_POST["comment"];
$regfile      = $_POST["regfile"];
$submit       = $_POST["submit"];

if(empty($submit)) {
	echo "<form name=\"allpyaward\" action=\"" . $PHP_SELF . "\" method=\"post\" enctype=\"multipart/form-data\" onsubmit=\"return formcheck()\">\n";
	echo "<table class=\"tvisible\" width=\"440\" cellSpacing=\"0\" cellPadding=\"4\">\n";
	echo "<tr>\n";
	echo "<td class=\"tdark\"><label for=\"progid\"><p><b>Program ID:</b></p></label></td>\n";
	echo "<td><input type=\"text\" class=\"text\" name=\"progid\" size=\"35\" maxlength=\"10\"></td>\n";
	echo "</tr><tr>\n";
	echo "<td class=\"tdark\"><label for=\"title\"><p><b>Program Title:</b></p></label></td>\n";
	echo "<td><input type=\"text\" class=\"text\" name=\"title\" size=\"35\" maxlength=\"50\"></td>\n";
	echo "</tr><tr>\n";
	echo "<td class=\"tdark\"><label for=\"version\"><p><b>Program Version:</b></p></label></td>\n";
	echo "<td><input type=\"text\" class=\"text\" name=\"version\" size=\"35\" maxlength=\"20\"></td>\n";
	echo "</tr><tr>\n";
	echo "<td class=\"tdark\"><label for=\"dlsize\"><p><b>Download Size:</b></p></label></td>\n";
	echo "<td><select name=\"dlsize\">\n";
	echo "<option value=\"0\" selected>&lt; Select interval &gt; &nbsp; &nbsp;</option>\n";
	echo "<option value=\"Less than 0.5MB\">Less than 0.5MB</option>\n";
	echo "<option value=\"From 0.5MB to 1MB\">From 0.5MB to 1MB</option>\n";
	echo "<option value=\"From 1MB to 3 MB\">From 1MB to 3 MB</option>\n";
	echo "<option value=\"More than 3MB\">More than 3MB</option>\n";
	echo "</select></td>\n";
	echo "</tr><tr>\n";
	echo "<td class=\"tdark\"><label for=\"backlink\"><p><b>Backlink URL:</b></p></label></td>\n";
	echo "<td><input type=\"text\" class=\"text\" name=\"backlink\" size=\"50\" maxlength=\"60\" value=\"http://\"></td>\n";
	echo "</tr><tr>\n";
	echo "<td class=\"tdark\"><label for=\"mtext\"><p><b>Your comment:</b><br><small>(Optional, 1000 Chr. Max)</small></p></label></td>\n";
	echo "<td><textarea name=\"mtext\" rows=\"5\" cols=\"32\"></textarea></td>\n";
	echo "</tr><tr>\n";
	echo "<td class=\"tdark\"><label for=\"regfile\"><p><b>Registration File:</b><br><small>(Optional, 10 KB Max)</small></p></label></td>\n";
	echo "<td><input type=\"file\" class=\"file\" name=\"regfile\" size=\"38\"></td>\n";
	echo "</tr><tr>\n";
	echo "<td class=\"tdark\"><p><b>Submit:</b></p></td>\n";
	echo "<td><input type=\"submit\" class=\"button\" name=\"submit\" value=\"   Submit   \">&nbsp; &nbsp; &nbsp;<input type=\"reset\" class=\"button\" value=\"   Reset   \"></td>\n";
	echo "</tr>\n</table>\n</form>\n<br>\n";
}
else { // Processing received data
	$bad      = "";
	if(empty($progid)) { // If the program id field is empty
		$bad .= "You did not enter Program ID!<br>";
	}
	if(empty($title)) { // If the program title field is empty
		$bad .= "You did not enter Program Title!<br>";
	}
	if(empty($version)) { // If the program version field is empty
		$bad .= "You did not enter Program Version!<br>";
	}
	if($dlsize == "0") { // If the download size is not selected
		$bad .= "You did not select Download Size!<br>";
	}
	if(empty($backlink) or (strtolower($backlink) == "http://")) { // If the backlink URL field is empty
		$bad .= "You did not enter Backlink URL!<br>";
	}
	else {
		if(!($backlinkdata = @file($backlink))) {
			$bad.= "Error opening Back Link Page URL!<br>";
		}
		else {
			$backlinkdata = implode("",$backlinkdata);
			if (strstr($backlinkdata, "http://" . $_SERVER['HTTP_HOST']) === FALSE) {
				$bad.= "Back Link to http://" . $_SERVER['HTTP_HOST'] . " on established Back Link Page URL was NOT found!<br>";
			}
		}
	}
	if($_FILES["regfile"]["size"]>10240){ 
		$bad .= "The attached file size is larger than 10 KB!<br>";
	}
	if($bad) { // Displaying warning message and exiting
		echo "<h2 class=\"red\">" . $bad . "</h2>\n";
		echo "<p><b>Please go <a href=\"javascript:history.back()\">Back</a> and fill the form correctly.</b></p>\n";
	}
	else { // Form is OK
		$progid   = substr($progid,0,10);    // Cutting off too long program id
		$title    = substr($title,0,50);     // Cutting off too long program title
		$version  = substr($version,0,20);   // Cutting off too long program version
		$backlink = substr($backlink,0,60);  // Cutting off too long backlink URL
		$mtext    = substr($mtext,0,1000);   // Cutting off too long comment

		if (is_uploaded_file($_FILES["regfile"]["tmp_name"])) {
			$regfiledir = "upload/" . basename($_FILES["regfile"]["name"]);
			if(move_uploaded_file($_FILES["regfile"]["tmp_name"], $regfiledir)) {
				echo "<h2 class=\"green\">File successfully uploaded.<br></h2>";
			}
			else {
				echo "<h2 class=\"red\">Error uploading file!<br></h2>";
			}
		}
		
		// Generating email message from received data
		$subject  = $sitename . " - Applying for Award";
		$message  = "The following software has been submitted for " . $sitename . " Award:\r\n\r\n";
		$message .= "Program Title and Version: " . $title . " " . $version . "\r\n";
		$message .= "Approximate Download Size: " . $dlsize . "\r\n";
		$message .= "Program URL: http://" . $_SERVER['HTTP_HOST'] . "/details.php?progid=" . $progid . "\r\n";
		$message .= "Backlink URL: " . $backlink . "\r\n\r\n";
		if ($mtext) { 
			$message .= "Author comment:\r\n" . $mtext . "\r\n\r\n";
		}
		if ($regfiledir) { 
			$message .= "The attached file (" . $_FILES["regfile"]["size"] . " Bytes) has been uploaded to http://" . $_SERVER['HTTP_HOST'] . "/" . $regfiledir . "\r\n";
		}
		$headers  = "From: " . $sitename . "<" . $sitemail . ">\r\n";
		$headers .= "Reply-To: " . $sitename . "<" . $sitemail . ">\r\n";
		$headers .= "Content-Type: text/plain; charset=windows-1252";

		if(mail($sitemail, $subject, $message, $headers)) { // If message was successfully sent:
			echo "<h2 class=\"green\">Your message was sent. Thank You!<br></h2>\n";
		}
		else { // If any unspecified error occures:
			echo "<h2 class=\"red\">Sorry, an error occured while sending your message!<br></h2>\n";
			echo "<p><b>Please go <a href=\"javascript:history.back()\">back</a> and try again later.</b></p>\n";
		}
	}
}
?>
<br>

</td><td class="tbody" width="182">

</td>
</tr>
</table>

</td></tr></table>
<?php include("fooder.inc"); ?>